@extends('admin::index')

@section('content')
    <section class="content-header">
        <!-- <h1>
            {{ $header or trans('admin::lang.title') }}
            <small>{{ $description or trans('admin::lang.description') }}</small>
        </h1> -->
    </section>

    <section class="content">
        {{-- tian add flash提示信息 --}}
        @include('flash::message')

        @include('admin::partials.error')
        @include('admin::partials.success')
        @include('admin::partials.exception')
        @include('admin::partials.toastr')
        
        <div class="container">

            <div class="row">
                <div class="col-sm-12">
                    <div class="box">
                        <div class="box-body">
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title">配置</h3>
                                </div>
                                <div class="panel-body">
                                    <!-- 配置项 -->
                                    <div class="list-group">
                                        <form class="form-horizontal" method="POST">
                                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                            @foreach ($settings as $setting)
                                                <div class="form-group">
                                                    <label for="" class="col-sm-2 control-label">{{ $setting->alias }}:</label>
                                                    <div class="col-sm-10">
                                                        @if ($setting->setting)
                                                            <input type="text" class="form-control" name="{{ $setting->name }}" placeholder="请输入{{ $setting->alias }}" value="{{ $setting->setting->value }}" />
                                                        @else
                                                            <input type="text" class="form-control" name="{{ $setting->name }}" placeholder="请输入{{ $setting->alias }}" value="" />
                                                        @endif
                                                        
                                                    </div>
                                                </div>
                                            @endforeach

                                            
                                            <div class="form-group">
                                                <div class="col-sm-offset-2 col-sm-10">
                                                    <button type="submit" class="btn btn-primary" id="admin_conf_submit">确认</button>
                                                    <button type="button" class="btn btn-warning navbar-btn" title="发布会将配置写到配置文件" id="admin_conf_publish">发布</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section>
@endsection
